import warnings

from venya.lib import stdlib

class BgpError(Exception):
   def __init__(self, fmt, *args):
      super(BgpError, self).__init__()
      self._msg = stdlib.sprintf(fmt, *args)

   def __str__(self):
      return str(self._msg).encode('utf-8')

class Error(BgpError):
   pass

class ConfigError(BgpError):
   pass
